<template>
    <!-- 
    <b-modal ref="my-modal" hide-footer title="Using Component Methods">
     <div class="d-block text-center">
       <h3>Hello From My Modal!</h3>
     </div>
     <b-button class="mt-3" variant="outline-danger" block @click="hideModal">Close Me</b-button>
     <b-button class="mt-2" variant="outline-warning" block @click="toggleModal">Toggle Me</b-button>
   </b-modal> 
    -->
    <!--
        body-class="modalStyle" 表示样式
        size="lg" 表示模态窗口大小 xl,lg,sm,full
        hide-footer 表示隐藏底部按钮
        hide-header 表示隐藏头部内容
        no-close-on-backdrop 表示鼠标点击背景不可关闭
        hide-header-close 表示隐藏头部关闭按钮
        centered 居中
        ok-title=“确定” 
        cancel-title=取消
        @ok="handleOk" 
        @cancel="handleCancel"
        scrollable 滚动条
        hide-backdrop 隐藏背景
        wrapClassName="ant-modal-cust-warp" 
        style="top:5%;height: 85%;overflow-y: hidden" 样式
    -->
    <b-modal ref="my-modal" size="xl" :title="title" hide-footer scrollable no-close-on-backdrop>
        <div class="d-block text-center">
            <b-card no-body>
                <!--配置参数：
                    small:表示小号
                    pills:清爽型
                    no-body
                    card:卡片布局
                -->
                <b-tabs pills card>
                    <b-tab active  title="基本信息">     
                        <template #title>                            
                            实例
                        </template>       
                        <b-card-text>
                            <div class="m-form m-form--fit m-form--label-align-left m-form--group-seperator-dashed">
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">id</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.id" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">名称</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.name">
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">乐观锁</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.rev" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">流程实例</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.procInstId" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">业务Key</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.businessKey" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">父节点</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.parentId" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">流程定义</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.procDefId" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">superExec</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.superExec" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">节点编号</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.actId" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">是否存活</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.isActive" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">是否并行</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.isConcurrent" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">isScope</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.isScope" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">是否使用事件</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.isEventScope" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">是否挂起</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.suspensionState" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">缓存状态</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.cachedEntState" >
                                    </div>
                                </div>
                                <div class="form-group m-form__group row">
                                    <label class="col-md-2 col-form-label">租户</label>
                                    <div class="col-md-3">
                                        <input class="form-control" disabled v-model="lcDiagnoseForm.tenantId" >
                                    </div>
                                </div>
                            </div>
                        </b-card-text>              
                    </b-tab>
                    <b-tab  title="任务">
                        <template #title>                            
                            任务
                        </template>     
                        <b-card-text>
                            <LcDiagnoseTask :procInstId="procInstId"></LcDiagnoseTask> 
                        </b-card-text>
                    </b-tab>
                    <b-tab  title="变量">
                        <template #title>                            
                            变量
                        </template>     
                        <b-card-text>
                            <ActRuVariable :procInstId="procInstId"></ActRuVariable>  
                        </b-card-text>
                    </b-tab>
                    <b-tab  title="人员">
                        <template #title>                            
                            人员
                        </template>     
                        <b-card-text>
                            <ActRuIdentitylink :procInstId="procInstId"></ActRuIdentitylink>                              
                        </b-card-text>
                    </b-tab>
                </b-tabs>
            </b-card>
        </div>
        <template slot="modal-footer">
            <!--自定义按钮-->
        </template>
    </b-modal>      
      
</template>
<script>
import apiUtil from "@/core/util/apiUtil.js"; 
import ActRuVariable from "@/view/bpm/lc-diagnose/lc-actRuVariable.vue";
import LcDiagnoseTask from "@/view/bpm/lc-diagnose/lc-diagnose-task.vue";
import ActRuIdentitylink from "@/view/bpm/lc-diagnose/lc-actRuIdentitylink.vue";
import { handleNotify,handleAlert,handleConfirm,showWating,closeWating} from "@/core/util/jehcUtil.js";
export default {
    data(){
        return {    
            tabPosition: 'left',
            title:'诊断工具详情',
            roleData: {},
            procInstId:"",
            lcDiagnoseForm:{
                id:"",
                name:"",
                rev:"",
                procInstId:"",
                businessKey:"",
                parentId:"",
                procDefId:"",
                superExec:"",
                actId:"",
                isActive:"",
                isConcurrent:"",
                isScope:"",
                isEventScope:"",
                suspensionState:"",
                cachedEntState:"",
                tenantId:"",
            },

        }
    },
    components: {
        ActRuVariable,
        LcDiagnoseTask,
        ActRuIdentitylink,
    },
    watch: {
    },
    mounted() {
    },
    methods: {        
        showModal(row) {        
            this.procInstId = row.procInstId;   
            this.$refs['my-modal'].show();
            this.getDetail(row.id);
        },
        hideModal() {
            this.$refs['my-modal'].hide();
        },
        toggleModal() {
            // 当模态已隐藏时，我们传递要返回焦点的按钮的ID
            this.$refs['my-modal'].toggle('#toggle-btn')
        },
        getDetail(id){
            apiUtil.get(process.env.VUE_APP_BPM_API+"/actRuExecution/get/"+id).then(({ data }) => {
                this.lcDiagnoseForm = data.data;
            });
        },
   }
}
</script>